package customize

import (
	v1 "gitcode.com/G-YT/baoyou/server/api/v1"
	"gitcode.com/G-YT/baoyou/server/middleware"
	"github.com/gin-gonic/gin"
)

type EfficacyRouter struct {
}

func (e *EfficacyRouter) InitEfficacyRouter(Router *gin.RouterGroup) {
	assessRouter := Router.Group("efficacy")
	efficacyRouter := Router.Group("efficacy").Use(middleware.OperationRecord())
	efficacyRouterWithoutRecord := Router.Group("efficacy")
	efficacyApi := v1.ApiGroupApp.CustomizeApiGroup.EfficacyApi
	{
		assessRouter.GET("getEfficacyList", efficacyApi.GetEfficacyList)          // 获取功效列表
		assessRouter.POST("saveUserEfficacyTag", efficacyApi.SaveUserEfficacyTag) // 保存功效标签
	}
	{
		efficacyRouter.POST("createEfficacy", efficacyApi.CreateEfficacy)             // 新建功效
		efficacyRouter.DELETE("deleteEfficacy", efficacyApi.DeleteEfficacy)           // 删除功效
		efficacyRouter.DELETE("deleteEfficacyByIds", efficacyApi.DeleteEfficacyByIds) // 批量删除功效
		efficacyRouter.PUT("updateEfficacy", efficacyApi.UpdateEfficacy)              // 更新功效
		efficacyRouter.POST("setEfficacyArticle", efficacyApi.SetEfficacyArticle)     // 设置功效文章关系
		efficacyRouter.GET("getEfficacyArticle", efficacyApi.GetEfficacyArticle)      // 获取功效文章关系
	}
	{
		efficacyRouterWithoutRecord.GET("findEfficacy", efficacyApi.FindEfficacy)                     // 根据ID获取功效
		efficacyRouterWithoutRecord.GET("getEfficacyListByWhere", efficacyApi.GetEfficacyListByWhere) // 根据条件获取功效列表
	}
}
